package com.example.business_oa.controller;

import com.example.business_oa.service.FuLiShenQingService;
import com.example.comment_oa.pojos.SysDept;
import com.example.comment_oa.pojos.SysEmployee;
import com.example.comment_oa.pojos.SysPost;
import com.example.comment_oa.pojos_vo.HySysEmpVo;
import com.example.comment_oa.response.AjaxResponse;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description:福利申请的Controller
 * @Author:李博文
 * @Date:2022/10/27 9:31
 */
@RestController
@CrossOrigin
@RequestMapping("/businessOa")
public class FuLiShenQingController {
    @Resource
    FuLiShenQingService fuLiShenQingService;

    @GetMapping("/bumenxiala")
    public AjaxResponse selectBumenXiala(){
        List<SysDept> sysDepts = fuLiShenQingService.selectBuMenXiaLa();
        return  AjaxResponse.success(sysDepts);
    }

    @GetMapping("/zhiweixiala")
    public AjaxResponse selectZhiWeiXiala(){
        List<SysPost> sysPosts = fuLiShenQingService.selectZhiWeiXiaLa();
        return  AjaxResponse.success(sysPosts);
    }

    @PostMapping("/all")
    public AjaxResponse selectAll(@RequestBody HySysEmpVo hySysEmpVo){
//        System.err.println(hySysEmpVo);
//        System.err.println("进来了吗");
        List<SysEmployee> sysEmployees = fuLiShenQingService.selectAll(hySysEmpVo);
        return  AjaxResponse.success(sysEmployees);
    }
}
